#include <bits/stdc++.h>
using namespace std;
int n,a,d[100005],l,ans;
int main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    for(int i=0;i<n;i++)
    {
        cin>>a;
        d[a]++;
    }
    for(int i=1;i<=100000;i++)
    {
        if(d[i]!=0)
        {
            ans+=min(l,d[i]);
            l=d[i];
        }
    }
    cout<<n-ans<<endl;
    return 0;
}
